import $http from '@/assets/js/http'

//查询所有已开通分站城市
export function getCityList(index, size) {
    return $http.get('/api/substation/city/list', {
        params: {pageIndex: index, pageSize: size }
    });
}

//查询话题列表
export function getTopicList(title,index, size) {
    return $http.get('/manage/topic/list', {
        params: {title:title,pageIndex: index, pageSize: size }
    });
}


//删除话题
export function postDeleteTopic(delId) {
    return $http.post('/manage/topic/delete', {
        id: delId
    });
}
//发布话题
export function postAddTopic(param) {
    return $http.post('/manage/topic/publish', {
        cityId:param.cityId,
        title: param.title,
        headImg: param.headImg,
        content:param.content,
        author:param.author,
    });
}
//编辑话题
export function postEditTopic(param) {
    return $http.post('/manage/topic/update', {
        id:param.id,
        cityId:param.cityId,
        title: param.title,
        headImg: param.headImg,
        content:param.content,
        author:param.author,
    });
}
